<template>
  <div id="root">
    <el-container class="container">
      <el-aside class="nav-left" width="220px">
        <div class="logo">
          <img src="@/assets/logo.jpg" />
          <p>小飞</p>
        </div>
        <div class="nav-content">
          <ul>
            <li>
              <router-link tag="li" to="/user">
                个人资料<i class="el-icon-arrow-right"></i>
              </router-link>
            </li>
            <li>
              <router-link tag="li" to="/user">
                个人资料<i class="el-icon-arrow-right"></i>
              </router-link>
            </li>
            <li>
              <router-link tag="li" to="/user">
                个人资料<i class="el-icon-arrow-right"></i>
              </router-link>
            </li>
            <li>
              <router-link tag="li" to="/user">
                个人资料<i class="el-icon-arrow-right"></i>
              </router-link>
            </li>
          </ul>
        </div>
        <!-- 导航 -->
      </el-aside>
      <el-container>
        <el-header class="header-top">{{header}}</el-header>
        <el-main class="content">
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
      header: '',
      navData: [
        {
          'name': '个人资料',
          'list': []
        },
        {
          'name': '技术',
          'list': []
        },
        {
          'name': '简介',
          'list': []
        }
      ]
    }
  },

  created() {
    console.log(this.$route)
    this.header = this.$route.name
    console.log('created:这个时候已经可以使用到数据，也可以更改数据,在这里更改数据不会触发updated函数')
  },

}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
#root{
  height: 100%;
  height: 100%;
}
.container{
  height: 100%;
  width: 100%;
}
.logo{
  text-align: center;
  padding: 30px 0;
  img{
    width: 90px;
    border-radius: 50%;
  }
}
.nav-left{
  text-align: left;
  background: url('https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1545224100677&di=379c1b8e15415a8c5c8ba9c04d8c1c95&imgtype=0&src=http%3A%2F%2Fpic32.photophoto.cn%2F20140712%2F0008020935320565_b.jpg');
  &::-webkit-scrollbar {
    display: none;
  }
  .nav-content{
    ul li {
      text-indent: 50px;
      line-height: 50px;
      color: #666;
      font-size: 18px;
      &:hover{
        background-color: rgba(0,0,0,.2);
      }
    }
  }
}
.header-top{
  background-color: #bcbcbc;
  font-size: 28px;
  line-height: 60px;
  color: #fff;
}
.content{
  background-color: #efefef;
}
</style>
